package com.logichina.csms.controller;


import com.logichina.csms.service.IDealerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/sqdz")
@RestController
public class DealerController {


    @Autowired
    private IDealerService iDealerService;

    @RequestMapping(value = "{inform}",method = RequestMethod.GET)
    public String saveDealer(@PathVariable(name = "inform") String jsonDealer){
        jsonDealer = " {\n" +
                " \"body\":[\n" +
                "    {\n" +
                "        \"DEALERNAME\":\"XXXX\",\n" +
                "        \"DEALERCODE\":\"1\",\n" +
                "        \"DATE\":\"2020-07-27 10:22\",\n" +
                "        \"ORDERCODE\":\"XXXX\",\n" +
                "        \"ORDERPERSONID\":\"XXXXX\",\n" +
                "        \"ORDERPERSONCODE\":\"XXXXX\",\n" +
                "        \"ORDERPERSONNAME\":\"XXXXX\",\n" +
                "        \"CONTACT\":\"XXXXXX\",\n" +
                "        \"FIXPHONE_AREACODE\":\"\",\n" +
                "        \"FIXPHONE\":\"\",\n" +
                "        \"MOBILE\":\"XXXXXXX\",\n" +
                "        \"BRAND\":\"XXXXXXX\",\n" +
                "        \"CLIENTTYPE\":\"XXXXXX\",\n" +
                "        \"CLIENTNAME\":\"XXXXXX\",\n" +
                "        \"SALEPERSONNAME\":\"XXXXXX\",\n" +
                "        \"SALECONTACT\":\"XXXXXXX\",\n" +
                "        \"CERTIFICATETYPE\":\"XXXXX\",\n" +
                "        \"CERTIFICATENUMBER\":\"XXXXXXX\",\n" +
                "        \"IN_PROVINCE\":\"XXXXXXX\",\n" +
                "        \"IN_PROVINCEID\":\"XXXXXXXX\",\n" +
                "        \"IN_CITY\":\"XXXXX\",\n" +
                "        \"IN_CITYID\":\"XXXXXXX\",\n" +
                "        \"IN_COUNTY\":\"XXXXXX\",\n" +
                "        \"IN_COUNTYID\":\"XXXXX\",\n" +
                "        \"IN_ADDRESS\":\"XXXXXX\",\n" +
                "        \"ADDRESSRANGE\":\"XXXXXX\",\n" +
                "        \"MODEL\":\"XXXXXXXX\",\n" +
                "        \"CREDIT\":\"1\",\n" +
                "        \"DEPOSIT\":\"1\",\n" +
                "        \"VIN\":\"XXXXXX\",\n" +
                "        \"INDOOR\":\"1\",\n" +
                "        \"OUTDOOR\":\"1\"\n" +
                "    },\n" +
                "    {\n" +
                "        \"DEALERNAME\":\"XXXX\",\n" +
                "        \"DEALERCODE\":\"2\",\n" +
                "        \"DATE\":\"2020-07-27 17:54\",\n" +
                "        \"ORDERCODE\":\"XXXX\",\n" +
                "        \"ORDERPERSONID\":\"XXXXX\",\n" +
                "        \"ORDERPERSONCODE\":\"XXXXX\",\n" +
                "        \"ORDERPERSONNAME\":\"XXXXX\",\n" +
                "        \"CONTACT\":\"XXXXXX\",\n" +
                "        \"FIXPHONE_AREACODE\":\"\",\n" +
                "        \"FIXPHONE\":\"\",\n" +
                "        \"MOBILE\":\"XXXXXXX\",\n" +
                "        \"BRAND\":\"XXXXXXX\",\n" +
                "        \"CLIENTTYPE\":\"XXXXXX\",\n" +
                "        \"CLIENTNAME\":\"XXXXXX\",\n" +
                "        \"SALEPERSONNAME\":\"XXXXXX\",\n" +
                "        \"SALECONTACT\":\"XXXXXXX\",\n" +
                "        \"CERTIFICATETYPE\":\"XXXXX\",\n" +
                "        \"CERTIFICATENUMBER\":\"XXXXXXX\",\n" +
                "        \"IN_PROVINCE\":\"XXXXXXX\",\n" +
                "        \"IN_PROVINCEID\":\"XXXXXXXX\",\n" +
                "        \"IN_CITY\":\"xxxxxx\",\n" +
                "        \"IN_CITYID\":\"xxxxxx\",\n" +
                "        \"IN_COUNTY\":\"xxxxxx\",\n" +
                "        \"IN_COUNTYID\":\"XXXXX\",\n" +
                "        \"IN_ADDRESS\":\"XXXXXX\",\n" +
                "        \"ADDRESSRANGE\":\"XXXXXX\",\n" +
                "        \"MODEL\":\"XXXXXXXX\",\n" +
                "        \"CREDIT\":\"2\",\n" +
                "        \"DEPOSIT\":\"2\",\n" +
                "        \"VIN\":\"XXXXXX\",\n" +
                "        \"INDOOR\":\"2\",\n" +
                "        \"OUTDOOR\":\"2\"\n" +
                "    }\n" +
                " ]\n" +
                "} ";
        String result = iDealerService.saveDealer(jsonDealer);
        return result;
    }
}
